/*
 * 杭州绿漫科技有限公司
 * Copyright (c) 16-7-4 下午4:04.
 */

package com.jams.goodox.entity;

import android.text.TextUtils;

import com.google.gson.annotations.SerializedName;
import com.jams.goodox.net.BaseEntity;

import java.io.Serializable;

/**
 * 登录实体
 */
public class LoginBean extends BaseEntity {
    private LoginBeanData data;

    public LoginBeanData getData() {
        return data;
    }

    public void setData(LoginBeanData data) {
        this.data = data;
    }

    public static class LoginBeanData implements Serializable,Mapper<User> {
        private String alias;
        private String communityId;
        private String flag;
        private String headIcon;
        private String isSign;
        @SerializedName("mobile")
        private String mobileNum;
        private String roleId;
        private String token;
        private String userId;
        @SerializedName("nickname")
        private String userName;
        private String userType;
        private String represent;
        String icon;

        public String getIcon() {
            return icon;
        }

        public void setIcon(String icon) {
            this.icon = icon;
        }

        public String getRepresent() {
            return represent;
        }

        public void setRepresent(String represent) {
            this.represent = represent;
        }

        public String getAlias() {
            return TextUtils.isEmpty(alias)?"":alias;
        }

        public void setAlias(String alias) {
            this.alias = alias;
        }

        public String getCommunityId() {
            return communityId;
        }

        public void setCommunityId(String communityId) {
            this.communityId = communityId;
        }

        public String getFlag() {
            return flag;
        }

        public void setFlag(String flag) {
            this.flag = flag;
        }

        public String getHeadIcon() {
            return headIcon;
        }

        public void setHeadIcon(String headIcon) {
            this.headIcon = headIcon;
        }

        public String getIsSign() {
            return isSign;
        }

        public void setIsSign(String isSign) {
            this.isSign = isSign;
        }

        public String getMobileNum() {
            return mobileNum;
        }

        public void setMobileNum(String mobileNum) {
            this.mobileNum = mobileNum;
        }

        public String getRoleId() {
            return roleId;
        }

        public void setRoleId(String roleId) {
            this.roleId = roleId;
        }

        public String getToken() {
            return token;
        }

        public void setToken(String token) {
            this.token = token;
        }

        public String getUserId() {
            return userId;
        }

        public void setUserId(String userId) {
            this.userId = userId;
        }

        public String getUserName() {
            return userName;
        }

        public void setUserName(String userName) {
            this.userName = userName;
        }

        public String getUserType() {
            return userType;
        }

        public void setUserType(String userType) {
            this.userType = userType;
        }

        @Override
        public User transform() {
            User user=new User();
            user.setUserName(userName);
            user.setUserId(userId);
            user.setHeadPicName(headIcon);
            user.setMobileNum(mobileNum);
            user.setUserType(userType);
            user.setRepresent(represent);
            return user;
        }
    }
}
